

#MyDir<-paste("/home/jc217070/Maxent/Outputs3_Final/permutation.importance/ModUnit_Dendroaspis_polylepis",sep="")
#MyDir<-paste("/home/jc217070/GIS_and_raw_Layers/layer_processing/Copernicus",sep="")
MyDir<-paste("/home/jc217070/Maxent/Outputs3_Final/permutation.importance",sep="")
#MyDir<-paste("/home/jc217070/Maxent/Outputs3_Final/Final_Individual_Spp",sep="")

#load packages:
library(R.utils)

#ascList<-list.files(path=paste(MyDir),pattern=paste("_current.asc$"),full.names=TRUE, recursive=TRUE)
#ascList<-list.files(path=paste(MyDir),pattern=paste("_limitFactor.asc$"),full.names=TRUE, recursive=TRUE)
ascList<-list.files(path=paste(MyDir),pattern=paste(".asc$"),full.names=TRUE, recursive=TRUE)
#ascList<-list.files(path=paste("/home/jc217070/GIS_and_raw_Layers/NESP_3.3_Layers"), pattern=paste(".asc$"),full.names=TRUE, recursive=TRUE)

  for (file in ascList){
  
    #file<-paste(MyDir,"/AUS_Median_SpeciesLoss.asc",sep="")
    print(paste(Sys.time()," zipping file ",file, sep=""))
    gzip(filename=paste(file),overwrite=TRUE, remove=TRUE)
  }


# 
# 
# MyDir<-paste("/home/jc217070/Maxent/Outputs3_Final/HotSpots",sep="")
# 
# file<-paste(MyDir,"/AUS_Current_Hotspot.asc",sep="")
# print(paste(Sys.time()," ziping file ",file, sep=""))
# gzip(filename=paste(file),overwrite=TRUE, remove=FALSE)
# 

